﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>SelectGrid 弹出选择表格（JS）</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" /><link href="../demo.css" rel="stylesheet" type="text/css" />

    
    <script src="../../scripts/boot.js" type="text/javascript"></script>
    
    
    <script src="../CommonLibs/UserSelectWindow.js" type="text/javascript"></script>    
</head>
<body>
    <h1>SelectGrid 弹出选择表格（JS）</h1>      

    <input id="btnEdit1" class="mini-buttonedit" onbuttonclick="onButtonEdit"/>
    


    
    <script type="text/javascript">
        mini.parse();

        function onButtonEdit(e) {
            var buttonEdit = e.sender;

            var win = new UserSelectWindow();
            win.set({
                url: bootPATH + "../demo/data/AjaxService.jsp?method=SearchEmployees",                    
                title: "用户选择",
                width: 600,
                height: 350
            });
            
            win.show();
            win.search();

            //初始化数据
            win.setData(null, function (action) {
                if (action == "ok") {
                    //获取数据
                    var row = win.getData();
                    if (row) {                        
                        buttonEdit.setValue(row.id);
                        buttonEdit.setText(row.name);

                        alert("选中记录: " + row.name);
                    }
                }
            });
        }
        
    </script>
    <div class="description">
        <h3>Description</h3>
        
    </div>
</body>
</html>